home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / dbase / do1beta.zip / INHERIT.DO < prev    next >
Text File  |  1991-07-23  |  303b  |  14 lines

  1. /*
  2.     demonstrate inheritance of a base class
  3. */
  4. inherit(Int,Myint,[]);
  5.  
  6. /*
  7.     demo
  8. */
  9. v = new(Myint,1);
  10. ? "v is ",v;        % inherit the asString method from Int
  11. ? "v + 1 = ",v+1;    % inherit the + operator from Int
  12. ? "v - 1 = ",v-1;    % inherit the - operator from Int
  13. ? "parent of v is ",parent(v);
  14.